<?php
class TargetlockAction extends HomeAction{
    public function index(){
		$this->assign('pplist',A("Home"));
		$this->assign('title','Tag列表'.'-'.C('site_name').C('site_by'));
		$this->display('target_show');
    }
    public function show(){
		$this->display('targetlock_show');
    }
    public function jsondata(){		
		$vid=$_GET['id'];
		$pid=$_GET['p']?intval($_GET['p']):1;
		$rs=D("aplist");
		
		$arr=$rs->where()->limit(20)->page($page)->select();

		echo json_encode(array('rows'=>$arr,'total'=>$rs->where()->limit(20)->page($page)->count(),'error'=>null));
		return;
    }
    public function client_data(){
		if($_GET['BSSID'])
			$where['BSSID']=$_GET['BSSID'];

		$pid=$_GET['p']?intval($_GET['p']):1;
		

		$rs=D("clientlist");
		
		$arr=$rs->where($where)->limit(20)->page($page)->select();		
		echo json_encode(array('rows'=>$arr,'total'=>$rs->where($where)->limit(20)->page($page)->count(),'error'=>null));
		return;
    }
    public function setrelate(){
		$where['taskid']=$_POST['taskid'];
		if($id){
		    $rs=D("Task");
		    $arr=$rs->where($where)->save($_POST);
			echo $rs->getLastSql();
		}
	}
    public function setstatus(){
		$where[BSSID]=$_POST['BSSID'];
		$_POST['status'] = 'start';
		if($where[BSSID]){
		    $rs=D("aplist");
		    $arr=$rs->where($where)->save($_POST);
			echo $sql = $rs->getLastSql();
		}
		Log::record('调试的SQL：'.$sql , Log::SQL);
		
	}		
}
?>